// TODO 开发环境
// 需要把公共的配置导入并且合并
let { merge } = require('merge')
//引入公共的
let common = require('./webpack.common')
let { relativeUrl } = require('./path')
module.exports =merge(common,{
    mode: 'development',
    devServer: {
        static: {
            directory:relativeUrl('./public')
        },
        port: 8888,
        open: true,
        hot: true,
        // TODO webpack 配置跨域
        proxy: {
            '/api': {
                target: 'https://wx.maoyan.com/',
                pathRewrite: { '^/api': '' },
                changeOrigin:true
            }
        }
    }
}) 